const SET_COLLAPSED = "SET_COLLAPSED";

const appModel = {
  namespace: "$app",
  state: {
    // 左侧菜单折叠
    menuCollapsed: false,
  },
  effects: {
    *setCollapsed({ payload: isCollapsed }, { put }) {
      const p = { type: SET_COLLAPSED, payload: isCollapsed };
      yield put(p);
    },
  },
  reducers: {
    [SET_COLLAPSED](state, { payload: isCollapsed }) {
      return { ...state, menuCollapsed: isCollapsed };
    },
  },
};

export default appModel;
